package com.communism.core.tableinfo.constant;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author wangqinmin
 * @date 2023/4/9 10:25
 * @description: 共产主义接班人
 */
public class MySqlQuery {
    
    public String tablesSql() {
        return "show table status WHERE 1=1 ";
    }

    public String tableFieldsSql() {
        return "show full fields from `%s`";
    }


    public String tableName() {
        return "NAME";
    }


    public String tableComment() {
        return "COMMENT";
    }

    public String fieldName() {
        return "FIELD";
    }

    public String fieldType() {
        return "TYPE";
    }

    public String fieldComment() {
        return "COMMENT";
    }

    public String fieldKey() {
        return "KEY";
    }

    public boolean isKeyIdentity(ResultSet results) throws SQLException {
        return "auto_increment".equals(results.getString("Extra"));
    }

    public String[] fieldCustom() {
        return null;
    }
}
